cmake_minimum_required (VERSION 2.8)

project (gen2main)

# additional CMake modules
set(GEN2_CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules" CACHE PATH "Path to directory with addtional modules" FORCE)
mark_as_advanced(GEN2_CMAKE_MODULE_PATH)
set(CMAKE_MODULE_PATH "${GEN2_CMAKE_MODULE_PATH}")

add_subdirectory(gen2lib)
SET_PROPERTY(TARGET gen2lib PROPERTY ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/Libraries)

option(GEN2_BUILD_CONSOLE_APPLICATION "Build console application" FALSE)
if (GEN2_BUILD_CONSOLE_APPLICATION)
	add_subdirectory(gen2)
	SET_PROPERTY(TARGET gen2 PROPERTY RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
	ADD_DEPENDENCIES(gen2 gen2lib)
endif (GEN2_BUILD_CONSOLE_APPLICATION)

option(GEN2_BUILD_GUI_APPLICATION "Build GUI application" TRUE)
if (GEN2_BUILD_GUI_APPLICATION)
	add_subdirectory(gen2gui)
	SET_PROPERTY(TARGET gen2gui PROPERTY RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
	ADD_DEPENDENCIES(gen2gui gen2lib)	
endif (GEN2_BUILD_GUI_APPLICATION)
